# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年10月13日
"""
import pandas as pd
import os

path = '../数据文件/课件025/课件025-3/拆分.xlsx'

data = pd.read_excel(path)

分割列 = list(data['部门'].drop_duplicates())
new_data = pd.ExcelWriter('../数据文件/课件025/拆分表结果01.xlsx')

for i in 分割列:
	data1 = data[data['部门'] == i]
	data1.to_excel(new_data, sheet_name=i, index=False)

new_data.save()
new_data.close()

print(data)